<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/Store/Public/layui/css/layui.css"></link>
<script src="/Store/Public/Admin/js/jquery-1.10.1.min.js"></script>
<script src="/Store/Public/layer/layer.js"></script>
</head>
<body>


 <div class="layui-form-item">
   <label class="layui-form-label">原新角色</label>
    <div class="layui-input-block">
    <input type="text" name="name" value="<?php echo ($name); ?>"required  lay-verify="required" placeholder="Please enter a role" autocomplete="off" class="layui-input" style="width:70%">
</div>
&nbsp;&nbsp; &nbsp;&nbsp;
<div class="layui-form-item">
   <label class="layui-form-label">编辑角色</label>
    <div class="layui-input-block">
    <input type="text" name="name" id="name" data-id="<?php echo ($id); ?>" required  lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input" style="width:70%">
 &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
   <div class="layui-form-item">
     <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo" style="border-radius: 23px ;" id="tijiao">提交</button>
      <button type="reset" class="layui-btn layui-btn-primary"  style="border-radius: 23px;">重置</button>
    </div>
    </div>
</div>
<script>

		$('#tijiao').click(function(){
			var id=$('#name').attr('data-id');
			var name=$('#name').val();
			
			$.post('/Store/index.php/Admin/Role/save',{id:id,name:name},function(obj){
				  if(obj.pass==1){
					  
					  layer.open({
						  yes:function(index,layero){
							  window.location.reload();
							  layer.close(index);
						  }
					  });
				  }
				}) 
		})
	
</script>
</body>
</html>